<%@ page import="dk.fuddi.grails.Toilet" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Create Toilet</title>         
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${resource(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="list" action="list">Toilet List</g:link></span>
        </div>
        <div class="body">
            <h1>Create Toilet</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${toiletInstance}">
            <div class="errors">
                <g:renderErrors bean="${toiletInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" method="post" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="city">City:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'city','errors')}">
                                    <g:textField name="city" value="${toiletInstance?.city}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lat">Lat:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'lat','errors')}">
                                    <g:textField name="lat" value="${fieldValue(bean: toiletInstance, field: 'lat')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="lng">Lng:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'lng','errors')}">
                                    <g:textField name="lng" value="${fieldValue(bean: toiletInstance, field: 'lng')}" />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="paymentFree">Payment Free:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'paymentFree','errors')}">
                                    <g:select name="paymentFree" from="${dk.fuddi.grails.Toilet.PAYMENT_VALUES}" value="${toiletInstance?.paymentFree}"  />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="street">Street:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'street','errors')}">
                                    <g:textField name="street" value="${toiletInstance?.street}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="type">Type:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'type','errors')}">
                                    <g:select name="type" from="${dk.fuddi.grails.Toilet.TYPE_VALUES}" value="${toiletInstance?.type}"  />
                                </td>
                            </tr> 
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="zipCode">Zip Code:</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean:toiletInstance,field:'zipCode','errors')}">
                                    <g:textField name="zipCode" value="${fieldValue(bean: toiletInstance, field: 'zipCode')}" />
                                </td>
                            </tr> 
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><input class="save" type="submit" value="Create" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
